package com.zhangzeqin.code.view;

import com.zhangzeqin.code.controller.TimeController;
import com.zhangzeqin.code.controller.WordBookController;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class WordBookHandler implements ActionListener {
    private WordBookView wordBookView;
    /**
     * 实例化控制器对象,传输数据
     */
    WordBookController wordBookController=new WordBookController();

    /**
     * 时间控制层
     */
    TimeController timeController=new TimeController();

   //构造器
    public WordBookHandler(){

    }
    public WordBookHandler(WordBookView wordBookView){
        this.wordBookView=wordBookView;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        JButton jButton=(JButton)e.getSource();
        String text = jButton.getText();
        if("背诵单词".equals(text)){
         new LearnWordView();
        }else
            if ("个人信息".equals(text)){
            new CompleteUserView();
        } else
            if("学习记录".equals(text)){
                new StudyView();
            }
    }
}
